#pragma once

#define			_MAX_NAMESIZE				16
#define			SERVER_LISTEN_PORT			5816
#define			_MAX_MSGSIZE				1024
#define			_MAX_TALK_SIZE				512
#define			_INVALID_USER_ID			-1


#define SAFE_DELETE(ptr) { if(ptr){	try{ delete ptr; }catch(...){ } ptr = 0; } }


#define CC_SYNTHESIZE(varType, varName, funName)\
		protected: varType varName;\
		public: virtual varType get##funName(void) const { return varName; }\
		public: virtual void set##funName(varType var){ varName = var; }




#define			_CREATE_NEW_MSG_					\
					case msg_type_connect:			\
						msg	=new MsgConnect;		\
						break;						\
					case msg_type_talk:				\
						msg	=new MsgTalk;			\
						break;						\
					case msg_type_friend:			\
						msg	=new MsgFriend;			\
						break;				